home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5052 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.3 KB  |  41 lines

  1. Newsgroups: comp.lang.c,comp.lang.c++
  2. Path: cs.vu.nl!jalten
  3. From: jalten@cs.vu.nl (Alten JP)
  4. Subject: Re: New printf - like function, is it possible?
  5. Nntp-Posting-Host: kits.cs.vu.nl
  6. Followup-To: comp.lang.c,comp.lang.c++
  7. References: <4eqb3a$2r5@pan.otol.fi>
  8. Sender: news@cs.vu.nl
  9. Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
  10. Date: Thu, 1 Feb 1996 13:26:40 GMT
  11. X-Newsreader: TIN [version 1.2 PL2]
  12. Message-ID: <DM3MoH.Bu1.0.-s@cs.vu.nl>
  13.  
  14. Timo Sakari (tkes@rhea.otol.fi) wrote:
  15.  
  16. : Hi!
  17.  
  18. [flipflap]
  19. : PrintToWin(DEBUG_WIN_1, "some stuff etc, %d, %f, %s, var1, var2, str1);
  20. : PrintToWin(OTHER_WIN, "anything that printf accepts");
  21.  
  22. : So I want to print almost anything with this function without having
  23. : to write many functions to different argument types/number of arguments.
  24. : This should be possible in C++ (is it?), but is it possible in C ?
  25. : Can this be achieved by using void pointers and macros etc., or should
  26. : I give up and don't waste my time on this?
  27.  
  28. Check out va_arg, va_end, va_start and va_list (stdarg.h)
  29. and search for ellipsis (...) in the help and in your C/C++
  30. documentation.
  31.  
  32. Hope it helps,
  33.  
  34. Jelle Paul
  35.  
  36. --
  37. +-------------------------------------------------------+
  38. | Jelle Paul Alten                |   jalten@cs.vu.nl   |
  39. | Vrije Universiteit Amsterdam    |                     |
  40. +-------------------------------------------------------+
  41.